
package org.atm.domain;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *
 * 
 */
@Entity
@Table(name = "GROUPTABLE")
public class UserRole implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id @Column(name="USERNAME")
    private String userName;
    
    @Id @Column(name="GROUPID")
    private String group;
    
    public UserRole() {
    }

    public UserRole(String userName, String group) {
        this.userName = userName;
        this.group = group;
    }

    @Override
    public String toString() {
        return "UserRole{" + "userName=" + userName + ", group=" + group + '}';
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final UserRole other = (UserRole) obj;
        if ((this.userName == null) ? (other.userName != null) : !this.userName.equals(other.userName)) {
            return false;
        }
        if ((this.group == null) ? (other.group != null) : !this.group.equals(other.group)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (this.userName != null ? this.userName.hashCode() : 0);
        hash = 97 * hash + (this.group != null ? this.group.hashCode() : 0);
        return hash;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

}
